﻿<%@ Page Language="C#" MasterPageFile="~/Addmin/BackEnd/MTP_Admin.Master" AutoEventWireup="true" CodeBehind="BC_HangTon.aspx.cs" Inherits="Bussiness.View.BackEnd.BC_HangTon" %>

<%@ Register Assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
    Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    


                        <ext:Panel ID="Panel2" runat="server" Title="Danh sách sản phẩm trong kho" PaddingSummary="10px 5px 0 5px">
                            <Items>
                              <ext:GridPanel ID="DSHangHoa_Grid" IDMode="Static" runat="server" Height="300" AutoScroll="true"
                                Region="Center">
                                <Store>
                                    <ext:Store ID="DSHangHoa_Store" runat="server" AutoDataBind="true" SkipIdForNewRecords="false">
                                        <Reader>
                                            <ext:JsonReader IDProperty="ID">
                                                <Fields>
                                                    <ext:RecordField Name="ID" Type="String" Mapping="ID" />
                                                    <ext:RecordField Name="Name" Type="String" Mapping="Name" />
                                                    <ext:RecordField Name="Code" Type="String" Mapping="Code" />
                                                    <ext:RecordField Name="PriceImport" Type="Int" Mapping="PriceImport" />
                                                    <ext:RecordField Name="PriceExprort" Type="Int" Mapping="PriceExprort" />
                                                    <ext:RecordField Name="Count" Type="String" Mapping="Count" />
                                                    <ext:RecordField Name="ListSize" Type="String" Mapping="ListSize" />
                                                    <ext:RecordField Name="DateImport" Type="Date" Mapping="DateImport" />
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:Store>
                                </Store>
                                <ColumnModel ID="ColumnModel2" runat="server" AutoDataBind="true">
                                    <Columns>
                                        <ext:RowNumbererColumn />
                                        <ext:Column ColumnID="ID" Header="Mã" DataIndex="ID" Hidden="true" />
                                        <ext:Column Header="Mã hàng" DataIndex="Code" AutoDataBind="true" Width="70" MenuDisabled="True" />     
                                        <ext:Column Header="Tên" DataIndex="Name" AutoDataBind="true" Width="150" />
                                        <ext:Column Header="Số lượng" DataIndex="Count" AutoDataBind="true"  />
                                        <ext:Column Header="Size" DataIndex="ListSize" AutoDataBind="true" Width="70" MenuDisabled="True" />
                                        <ext:NumberColumn Header="Gía nhập" DataIndex="PriceImport" AutoDataBind="true" MenuDisabled="True"
                                            Format="0,00" />
                                        <ext:NumberColumn Header="Gía bán" DataIndex="PriceExprort" AutoDataBind="true" MenuDisabled="True"
                                            Format="0,00" />
                                        <ext:DateColumn Header="Ngày cập nhật" DataIndex="DateImport" AutoDataBind="true"
                                            MenuDisabled="True" Format="dd/MM/yyyy" />
                                        <ext:CommandColumn Header="Chi tiết">
                                            <Commands>
                                                <ext:GridCommand Icon="NoteEdit" CommandName="Edit" ToolTip-Text="Xem sản phẩm" />
                                            </Commands>
                                        </ext:CommandColumn>
                                    </Columns>
                                </ColumnModel>
                                <BottomBar>
                                    <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" StoreID="DSHangHoa_Store"
                                        DisplayInfo="false" />
                                </BottomBar>
                                <SelectionModel>
                                    <ext:RowSelectionModel runat="server" ID="RowSelectionModel1">
                                    </ext:RowSelectionModel>
                                </SelectionModel>
                                <Listeners>
                                    <Command Handler="detail(command, record.data.ID)" />
                                </Listeners>
                            </ext:GridPanel>
                             <ext:FieldSet ID="FieldSet1" runat="server" Layout="ColumnLayout"  PaddingSummary="20px 5px 0 5px" Border="false">
                                    <Items>
                            <ext:TextField runat="server" FieldLabel="Hàng tồn trong kho trị giá" ID="giaTriThanhTien" LabelWidth="150" Width="500" >
                            </ext:TextField>
                            </Items>
                            </ext:FieldSet>
                            </Items>
                             <Buttons>
                                <ext:Button runat="server" Text="In bảng kê" ID="Button2121" Icon="Printer">
                                    <Listeners>
                                        <Click Fn="Print" />
                                    </Listeners>
                                </ext:Button>
                                
                            </Buttons>
                        </ext:Panel>

        <ext:Window ID="TK_HangTon" runat="server" Icon="Group" Title="Danh mục hàng hóa" IDMode="Static"
        Width="1000" Height="1200" AutoShow="false" Modal="true" Hidden="true" Layout="FormLayout"
        LabelAlign="Left" PaddingSummary="10 10 0 10">
        <items>
            <ext:Panel ID="abc111" runat="server" Layout="FormLayout" AutoHeight="True" Title="Thống kê hàng tồn kho"
        Padding="10" >
            <Content>
         <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />
        </Content>
        
        </ext:Panel>
        </items>
    </ext:Window>

<script language="javascript">
    function detail(command, id) {
            window.location = "Product_Detail.aspx?Action=" + command + "&ID=" + id;

        }

        function Print() {
            window.location = "BC_HangTon.aspx?Action=print"
        }
</script>

</asp:Content>